Skip to content

resolve: Merge NameBindingKind::Module into NameBindingKind::Res #143458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 16, 2025

Conversation

petrochenkov
Copy link
Contributor

This is a simplification, but also an optimization, because now we load modules from external crates in a more lazy fashion.

@rustbot
Copy link
Collaborator

rustbot commented Jul 4, 2025

r? @SparrowLii

rustbot has assigned @SparrowLii.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 4, 2025
@petrochenkov
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 4, 2025
bors added a commit that referenced this pull request Jul 4, 2025
resolve: Merge `NameBindingKind::Module` into `NameBindingKind::Res`

This is a simplification, but also an optimization, because now we load modules from external crates in a more lazy fashion.
@bors
Copy link
Collaborator

bors commented Jul 4, 2025

⌛ Trying commit 72a1ac4 with merge d8766c2...

@bors
Copy link
Collaborator

bors commented Jul 5, 2025

☀️ Try build successful - checks-actions
Build commit: d8766c2 (d8766c2c7b1ffb11aa0b90c2861b10fc9b1c5c85)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d8766c2): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.7% [0.2%, 3.0%] 134
Regressions ❌
(secondary)
0.5% [0.2%, 1.2%] 47
Improvements ✅
(primary)
-1.1% [-2.1%, -0.3%] 8
Improvements ✅
(secondary)
-0.5% [-1.4%, -0.1%] 51
All ❌✅ (primary) 0.6% [-2.1%, 3.0%] 142

Max RSS (memory usage)

Results (primary -2.7%, secondary -3.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.3% [1.2%, 7.7%] 5
Improvements ✅
(primary)
-2.7% [-7.1%, -0.7%] 21
Improvements ✅
(secondary)
-4.1% [-12.5%, -1.2%] 80
All ❌✅ (primary) -2.7% [-7.1%, -0.7%] 21

Cycles

Results (primary 2.6%, secondary -2.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.6% [2.6%, 2.7%] 2
Regressions ❌
(secondary)
2.3% [0.7%, 4.1%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.4% [-9.4%, -1.9%] 9
All ❌✅ (primary) 2.6% [2.6%, 2.7%] 2

Binary size

Results (primary 1.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.1% [1.1%, 1.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.1% [1.1%, 1.1%] 1

Bootstrap: 460.645s -> 460.524s (-0.03%)
Artifact size: 372.20 MiB -> 371.76 MiB (-0.12%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 5, 2025
@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 5, 2025
@petrochenkov
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 5, 2025
@bors
Copy link
Collaborator

bors commented Jul 5, 2025

⌛ Trying commit e33d621 with merge 1556320...

bors added a commit that referenced this pull request Jul 5, 2025
resolve: Merge `NameBindingKind::Module` into `NameBindingKind::Res`

This is a simplification, but also an optimization, because now we load modules from external crates in a more lazy fashion.
@bors
Copy link
Collaborator

bors commented Jul 5, 2025

☀️ Try build successful - checks-actions
Build commit: 1556320 (155632099e9c457a68936de5f744ba18b66f9fef)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1556320): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.0%, 0.8%] 9
Improvements ✅
(primary)
-0.5% [-2.1%, -0.1%] 28
Improvements ✅
(secondary)
-0.5% [-1.3%, -0.0%] 57
All ❌✅ (primary) -0.5% [-2.1%, -0.1%] 28

Max RSS (memory usage)

Results (primary -3.0%, secondary -3.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.1% [1.3%, 6.4%] 4
Improvements ✅
(primary)
-3.0% [-7.5%, -0.8%] 28
Improvements ✅
(secondary)
-3.8% [-13.1%, -0.8%] 119
All ❌✅ (primary) -3.0% [-7.5%, -0.8%] 28

Cycles

Results (primary -3.8%, secondary -1.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
5.0% [4.4%, 5.6%] 2
Improvements ✅
(primary)
-3.8% [-3.8%, -3.8%] 1
Improvements ✅
(secondary)
-4.2% [-9.4%, -1.4%] 5
All ❌✅ (primary) -3.8% [-3.8%, -3.8%] 1

Binary size

Results (secondary -0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 1
All ❌✅ (primary) - - 0

Bootstrap: 461.008s -> 459.616s (-0.30%)
Artifact size: 372.14 MiB -> 372.19 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 6, 2025
@petrochenkov
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 6, 2025
@petrochenkov
Copy link
Contributor Author

ping @SparrowLii
This is a pre-requisite for the import parallelization changes (also not a complex change, just a refactoring).

@bors

This comment was marked as resolved.

Copy link
Member

@SparrowLii SparrowLii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The perf result looks good! Can you rebase the change so we can merge it?

@petrochenkov
Copy link
Contributor Author

Rebased.

@SparrowLii
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 16, 2025

📌 Commit 7f398fd has been approved by SparrowLii

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Jul 16, 2025

🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 16, 2025
@bors
Copy link
Collaborator

bors commented Jul 16, 2025

⌛ Testing commit 7f398fd with merge 1c6de21...

@bors
Copy link
Collaborator

bors commented Jul 16, 2025

☀️ Test successful - checks-actions
Approved by: SparrowLii
Pushing 1c6de21 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 16, 2025
@bors bors merged commit 1c6de21 into rust-lang:master Jul 16, 2025
12 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 16, 2025
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing f21fbac (parent) -> 1c6de21 (this PR)

Test differences

Show 26 test diffs

26 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 1c6de215099bbe33668de762f9591187f6c25eef --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-aarch64-linux: 5745.4s -> 8494.2s (47.8%)
  2. x86_64-apple-2: 3900.6s -> 5462.3s (40.0%)
  3. x86_64-apple-1: 6674.6s -> 8178.9s (22.5%)
  4. pr-check-1: 1519.5s -> 1858.9s (22.3%)
  5. pr-check-2: 2327.9s -> 2792.9s (20.0%)
  6. aarch64-apple: 5209.7s -> 5971.3s (14.6%)
  7. x86_64-gnu-llvm-20-1: 3217.8s -> 3646.3s (13.3%)
  8. aarch64-gnu: 6255.4s -> 7024.5s (12.3%)
  9. x86_64-gnu-tools: 3329.4s -> 3734.6s (12.2%)
  10. x86_64-rust-for-linux: 2652.8s -> 2965.1s (11.8%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

bors added a commit that referenced this pull request Jul 16, 2025
[WIP] resolve: Use interior mutability for extern module map

Based on #143458.

Module map for extern modules is a lazily populated cache, it's not *significantly* mutable.
If some logic in name resolver is parallelized, then this cache can be populated from any thread, and without affecting results of any speculative resolution.

cc `@LorrensP-2158466`
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1c6de21): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.2%, 0.2%] 1
Regressions ❌
(secondary)
0.7% [0.7%, 0.8%] 3
Improvements ✅
(primary)
-0.5% [-2.1%, -0.1%] 30
Improvements ✅
(secondary)
-0.4% [-1.4%, -0.0%] 65
All ❌✅ (primary) -0.5% [-2.1%, 0.2%] 31

Max RSS (memory usage)

Results (primary -3.1%, secondary -3.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.5% [0.8%, 2.2%] 2
Improvements ✅
(primary)
-3.1% [-7.1%, -0.5%] 12
Improvements ✅
(secondary)
-3.5% [-8.1%, -1.1%] 77
All ❌✅ (primary) -3.1% [-7.1%, -0.5%] 12

Cycles

Results (primary -2.9%, secondary 4.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
5.7% [2.8%, 10.9%] 6
Improvements ✅
(primary)
-2.9% [-2.9%, -2.9%] 1
Improvements ✅
(secondary)
-3.5% [-3.5%, -3.5%] 1
All ❌✅ (primary) -2.9% [-2.9%, -2.9%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 465.569s -> 464.891s (-0.15%)
Artifact size: 374.85 MiB -> 374.78 MiB (-0.02%)

@ZequanWu

This comment was marked as off-topic.

@SparrowLii

This comment was marked as off-topic.

@ZequanWu

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants